//
//  CommendCell.m
//  XRmenu
//
//  Created by shengchao yang on 11-12-2.
//  Copyright (c) 2011年 foxhis. All rights reserved.
//

#import "CommendTableCell.h"
#import "PluPlu.h"

@implementation CommendTableCell
@synthesize celldata;

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(void) setCelldata:(PluPlu *)onePluPlu
{
	if ([self viewWithTag:kTagOfStartLabel]) {
		UILabel *tl = (UILabel*)[self viewWithTag:kTagOfStartLabel];
		if (tl) {
			NSString *txt = JsonFiled(onePluPlu.ppNames);
			[tl setText:txt];
			
		}
	}
    
    if ([self viewWithTag:kTagOfStartLabel+1]) {
		UILabel *tl = (UILabel*)[self viewWithTag:kTagOfStartLabel+1];
		if (tl) {            
            NSString* unit=JsonFiled(onePluPlu.ppUnits);
            NSString* price  = [NSString stringWithFormat:@"%@%0.2f",[APPSESSION.allconfig getStringValueAtPath:@"System Config/currency"],[onePluPlu.ppPrice floatValue]];
            if ([onePluPlu.ppPrice floatValue]==0) {
                price=loc(@"时价");
            }
			[tl setText:[NSString stringWithFormat:@"%@/%@",price,unit]];
		}
	}
    
    if ([self viewWithTag:kTagOfStartLabel+2]) {
		UILabel *tl = (UILabel*)[self viewWithTag:kTagOfStartLabel+2];
		if (tl) {
			NSString *txt =JsonFiled(onePluPlu.ppRemarks); 
			[tl setText:txt];
			
		}
	}
}

@end
